package org.point.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Generator {
	
	/**
	 * 閭�璇风爜鐢熸垚鍣�
	 * @param memberid
	 * @return
	 */
	public static String generateInvcode(Integer memberid){
		String invcode="";
		String idStr=memberid.toString();
		int len=idStr.length();
		
		SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
		String dateStr=sdf.format(new Date());
		
		if(len>=6){
			invcode=dateStr.substring(3, 4)+idStr;
		}else{
			int dateLen=6-len;
			invcode=dateStr.substring(3, 3+dateLen)+idStr;
		}
		return invcode;
	}

}
